package com.qipay.sp.impl;

import com.qipay.baas.model.CpSpChannel;
import com.qipay.mapper.CpSpChannelMapper;
import com.qipay.sp.CpSpChannelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CpSpChannelServiceImpl implements CpSpChannelService {

    @Autowired
    CpSpChannelMapper cpSpChannelMapper;

    @Override
    public int insert(CpSpChannel record) {
        return cpSpChannelMapper.insert(record);
    }

    @Override
    public void delete(int spChannelId,int agentId) {
        cpSpChannelMapper.deleteBySpChannelId(spChannelId,agentId);
    }

    @Override
    public List<CpSpChannel> selectByCpIdAndType(int cpId, int channelType) {
        return cpSpChannelMapper.selectByCpIdAndType(cpId,channelType);
    }

    @Override
    public List<CpSpChannel> selectBySpChannelId(int spChannelId) {
        return cpSpChannelMapper.selectBySpChannelId(spChannelId);
    }
    @Override
    public List<Long> selectSpIds(int cpId, int channelType) {
        return cpSpChannelMapper.selectSpIds(cpId,channelType);
    }

    @Override
    public List<Long> selectSpIdsFirst(int cpId, int channelType, int first) {
        return cpSpChannelMapper.selectSpIdsFirst(cpId,channelType,first);
    }

    @Override
    public List<Long> selectSpIdsFirstDouble(int cpId, int channelType, int priceSupportDouble, int first) {
        return cpSpChannelMapper.selectSpIdsFirstDouble(cpId,channelType,priceSupportDouble,first);
    }

}
